export default () => {
  var div = document.createElement('div')
  var show = false
  window.fgfjgfgfkghcfhkgcrtrccr = () => {
    let v = window['xsba-kxhs-dghas-fkjgsadk'].value
    console.log(v)
    localStorage.getItem('switchApi_baseUrl') = v
    location.reload()
  }
  window.fribhsakxbsakxhuisabkxsavsavbxsa = () => {
    show = false
    document.body.removeChild(div)
  }
  var styles = {
    box: ` position: fixed;
      top: 0px;
      left: 0px;
      background: #04be02;
      color: #fff;
      padding: 3px 19px;
    z-index: 9999;
      border-radius: 4px;`,
    botton: `
      width: 7.02rem;
      height: .88rem;
      background: #5E8EFE;
      border-radius: .1rem;
      margin: auto;
      text-align: center;
      line-height: .88rem;
      color: #fff;
      font-size: .28rem;
      margin-top: .35rem;`
  }
  div.innerHTML = `<div style="${styles.box}">
    <div>api</div>
  </div>
  `
  div.onclick = () => {
    if(show) return
    show = true
      div.innerHTML = `<div style="${styles.box}background: #000;padding: 20px">
          <div>
        <textarea id="xsba-kxhs-dghas-fkjgsadk" style="user-select: auto;width: 90vw;color: #000">${localStorage.getItem('switchApi_baseUrl') ? localStorage.getItem('switchApi_baseUrl') : 'http://ip/tuxiaozhu/'}</textarea>
      </div>
      <div style="${styles.botton}" onclick="fgfjgfgfkghcfhkgcrtrccr()">修改</div>
      <div style="${styles.botton}" onclick="fribhsakxbsakxhuisabkxsavsavbxsa()">取消API按钮</div>
      </div>
      `
  }
  document.body.appendChild(div)
}